﻿using System.Collections;
using UnityEngine;

public class TowerLogic : MonoBehaviour
{
    public GameObject projectile;
    public Transform muzzle;
    public BaseItemScript _baseItem;
    public void SetData(BaseItemScript self)
    {
        _baseItem = self;
        muzzle = _baseItem.unitBase.muzzle;
    }

    public void Attack(BaseItemScript target)
    {
        GameObject go = Instantiate(projectile, muzzle.position, Quaternion.identity);
        go.GetComponent<Projectile>().SetData(_baseItem,target);
    }
}